package com.example.test_app.Util;

import android.content.Context;

import java.io.File;
import java.io.IOException;

import dalvik.system.DexClassLoader;
import dalvik.system.DexFile;

public class ClassLoaderUtil {

    public static ClassLoader create(Context context,String path,String optimizedDirectory,String libPath){
        DexClassLoader dexClassLoader=new DexClassLoader(path,optimizedDirectory,null,context.getClassLoader());
        return dexClassLoader;

    }

    public static Class<?> getClassForPath(ClassLoader classLoader,String path,String className) throws IOException {
        DexFile dexFile=new DexFile(new File(path));
        return dexFile.loadClass(className,classLoader);

    }

}
